home *** CD-ROM | disk | FTP | other *** search
/ Info-Mac 3 / Info_Mac_1994-01.iso / Development / Source / MultiSession 1.04 Source / Core 27⁄June⁄1993 / CObject.c < prev    next >
Encoding:
C/C++ Source or Header  |  1993-04-09  |  579 b   |  34 lines  |  [TEXT/KAHL]

  1. /* CObject.c */
  2.  
  3. #include "CObject.h"
  4. #include "Memory.h"
  5.  
  6.  
  7. #define MemoryFillPattern (0x81)
  8.  
  9.  
  10. void*        CObject::operator new (EXECUTE(register) unsigned long nBytes)
  11.     {
  12.         Handle    Temp;
  13.         EXECUTE(register char*        Scan;)
  14.  
  15.         Temp = AllocHandle(nBytes);
  16.         SetTag(Temp,"CObject");
  17.         EXECUTE(
  18.         /* this zeros the contents of all objects, making error detection easier */
  19.         Scan = *Temp;
  20.         while (nBytes > 0)
  21.             {
  22.                 (*Scan) = MemoryFillPattern;
  23.                 Scan += 1;
  24.                 nBytes -= 1;
  25.             })
  26.         return Temp;
  27.     }
  28.  
  29.  
  30. void        CObject::operator delete(void* Object)
  31.     {
  32.         ReleaseHandle((Handle)Object);
  33.     }
  34.